From e653a8058e7b9db57ca0af167580a108fc2622bd Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Thu, 8 Mar 2007 15:21:10 +0000 Subject: [PATCH] xen: Provide notification of console updates via VIRQ. The readconsolering capabilities provide the opportunity to provide console output to other clients (remote systems, logging systems, etc). This patchs adds the ability to generate a notification of a change in the console buffer. Signed-off-by: Ben Thomas Signed-off-by: Keir Fraser --- xen/common/event_channel.c | 3 +++ xen/drivers/char/console.c | 2 ++ xen/include/public/xen.h | 1 + 3 files changed, 6 insertions(+) diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 2b361f501e..6054527286 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -560,6 +560,9 @@ void send_guest_global_virq(struct domain *d, int virq) ASSERT(virq_is_global(virq)); + if ( unlikely(d == NULL) ) + return; + v = d->vcpu[0]; if ( unlikely(v == NULL) ) return; diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 03045963c9..927b47112f 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -399,6 +399,8 @@ static void __putstr(const char *str) vga_putchar(c); putchar_console_ring(c); } + + send_guest_global_virq(dom0, VIRQ_CON_RING); } static int printk_prefix_check(char *p, char **pp) diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index 3b6e4a8b2b..cf00a62e7a 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -131,6 +131,7 @@ #define VIRQ_TBUF 4 /* G. (DOM0) Trace buffer has records available. */ #define VIRQ_DEBUGGER 6 /* G. (DOM0) A domain has paused for debugging. */ #define VIRQ_XENOPROF 7 /* V. XenOprofile interrupt: new sample available */ +#define VIRQ_CON_RING 8 /* G. (DOM0) Bytes received on console */ /* Architecture-specific VIRQ definitions. */ #define VIRQ_ARCH_0 16 -- 2.30.2